const IS_PROD = ['production'].includes(process.env.NODE_ENV)
// const IS_YANSHI = process.argv.includes('--yanshi')
const _uwVersion = 'b2c' + new Date().getTime()

module.exports = {
  // prefix: '/api', // API接口前缀
  // proAPI: 'https://api3.zowoyoo.com', // 正式环境
  // devAPI: 'http://task-api-stag.zowoyoo.com', // 预上线环境
  publicPath: IS_PROD ? 'https://d.zowoyoo.com/saasb2c/' : '/newb2c',
  // publicPath: '/newb2c',
  // CDN 加速配置 版本要对上
  cdn: {
    config: {
      vue: 'Vue',
      axios: 'axios',
      'vue-router': 'VueRouter',
      vuex: 'Vuex',
      'vue-i18n': 'VueI18n',
      'vue-lazyload': 'VueLazyload',
      uw: 'z-uw'
    },
    link: {
      js: [
        'https://d.zowoyoo.com/ajax/libs/vue/2.5.16/vue2.6.10.js', // 2.6.10
        'https://d.zowoyoo.com/ajax/libs/vue/plugin/vue-lazyload1.3.3.js',
        'https://d.zowoyoo.com/ajax/libs/vue/2.5.16/axios.min.js', // 0.18.0
        'https://d.zowoyoo.com/ajax/libs/vue/2.5.16/vue-router.min.3.0.3.js',
        'https://d.zowoyoo.com/ajax/libs/vue/2.5.16/vuex.min.3.0.1.js',
        'https://d.zowoyoo.com/ajax/libs/vue/vue-i18n/dist/vue-i18n.js.js',
        `https://d.zowoyoo.com/ajax/libs/zwy/uw.min.js?v=${_uwVersion}`
      ],
      css: [
        `https://d.zowoyoo.com/ajax/libs/zwy/index.css?v=${_uwVersion}`
      ]
    }
  },
  dev: {
    link: {
      js: [
        'https://d.zowoyoo.com/ajax/libs/vue/2.5.16/vue2.6.10.js',
        `https://d.zowoyoo.com/ajax/libs/zwystag/uw.min.js?v=${_uwVersion}`
      ],
      css: [
        `https://d.zowoyoo.com/ajax/libs/zwy/index.css?v=${_uwVersion}`
      ]
    }
  }
}
